<template>

  <div class="film">
    <img-icon
      v-for="(d,index) in data" v-bind:key="index"
      :film="d.name"
      :value="d.sum"
      :img="d.url"
      style="    width: 230px;
    height: 350px;" />
  </div>
</template>

<script>
import ImgIcon from '@/components/ico/home/imgIcon.vue'
import axios from 'axios'

export default {
  components: { ImgIcon },
  data() {
    return {
      data: []
    }
  },
  methods: {
    getFile(n) {

      axios.get('/api/file/getIndexFile', {
        params: {
          k: n
        },
        headers: {
          Authorization: localStorage.getItem('token')
        }
      }).then(res => {


        for (let i = 0; i < res.data.data.length; i++) {
          this.data.push(res.data.data[i])
        }
      })
    }
  },
  mounted() {

    this.getFile(1)
  }
}
</script>

<style scoped>
.film {

  width: 100%;
  height: 100vh;
  margin-top: 20px;
}

/deep/ .el-text {
  text-align: left;
  width: 210px;
  color: aliceblue;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 25px;
  white-space: nowrap;
}

/deep/ .el_div {
  width: 240px;
}
</style>